<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Insert title here</title>
</head>
<body>
	<h1> 자바 표준 태그 라이브러리: JSTL</h1>
	<h3>functions: 함수 라이브러리</h3>
	<p>contains</p>
	<p>startsWith / endsWith</p>
	<p>escapeXml</p>
	<p>indexOf</p>
	<p>length</p>
	<p>trim</p>
	<p>substring</p>
	<p>split</p>
	
	<c:set var="jumin" value="123456-1234567"/>
	<c:set var="html" value="<h1>hello, jstl!! </h1>"/>
	<c:set var="token" value="1,2,3,4,5,6,7,8,9,0"/>
	<c:set var="action" value="game__mania"/>
	
	<p>문자열 길이: ${fn:length(jumin)}</p>
	<p>문자열 추출: 성별 - ${fn:substring(jumin, 7, 8)}</p>
	<p>문자 포함여부(결과는 위치): ${fn:indexOf(jumin,'-')}, ${fn:indexOf(jumin,'*')} </p>
	<p>특정 문자열로 시작하는지 여부: ${fn:startsWith(action, 'game')}, ${fn:startsWith(action, 'mania')}</p>
	<p>특정 문자열로 끝나는지 여부: ${fn:endsWith(action, 'mania')},${fn:endsWith(action, 'game')}</p>
	<p>문자 포함 여부: ${fn:contains(jumin,7)}, ${fn:contains(jumin,8)}</p>
	<p>여백 제거: ${'     aaa        '}, ${fn:trim('     aaa     ')}</p>
	<!-- 1,2,3,4,5,6,7,8,9,0이 ,가 제외된 채로 출력됨. -->
	<p>문자열을 문자들로 나눔: ${fn:split(token, ',')},
		<c:forEach var="t" items="${fn:split(token, ',')}">${t}</c:forEach>	
	</p>
	<p>문자열을 escaping 함: ${html},${fn:escapeXml(html)}, </p>

</body>
</html>